using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Azure;
using Microsoft.AspNetCore.Mvc;
using YayiMgr.Ability.Docking.Commom;
using YayiMgr.Ability.Docking.UserApp;
using YayiMgr.Ability.Docking.UserApp.Dto;

namespace YayiMgr.Web.Controllers.System
{
    [ApiController]
    [Route("api/[controller]")]
    public class LoginController : ControllerBase
    {
        public IUserServicer UserServicer { get; set; }

        [HttpGet]
        public async Task<ResponseDto<LoginSuccessDto>> CheckLogin(string userName, string password) 
        {
            return await UserServicer.CheckLogin(userName, password);
        }

        [HttpPost]
        public async Task<ResponseDto<UserRegisterDto>> Register(UserRegisterCreateDto createDto)
        {
            return await UserServicer.Register(createDto);
        }
    }
}